﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Resources;
using MVCScaffold.UI;
using System.Reflection;

namespace MVCScaffold.Suporte
{
    public class Mensagens
    {
        private static Mensagens _instance;
        public ResourceManager ResourceManager { get; private set; }

        public static Mensagens GetInstance()
        {
            return GetInstance(typeof(FormPrincipal).Assembly);
        }

        public static Mensagens GetInstance(string caminhoAssembly)
        {
            return GetInstance(Assembly.LoadFrom(caminhoAssembly));
        }

        private static Mensagens GetInstance(Assembly assembly)
        {
            lock (typeof(Mensagens))
            {
                return _instance ?? (_instance = new Mensagens
                                                   {
                                                       ResourceManager = new ResourceManager("MVCScaffold.UI.Mensagens.MVCScaffold", assembly)
                                                   });
            }
        }

    }
}
